{% autoescape true %}

(nl2br is pre_escaped for "html" and declared safe for "html")

1. Pre-escape and don't post-escape
( var|escape|nl2br )
{{ var|nl2br }}

2. Don't double-pre-escape
( var|escape|nl2br )
{{ var|escape|nl2br }}

3. Don't escape safe values
( var|raw|nl2br )
{{ var|raw|nl2br }}

4. Don't escape safe values
( var|escape|nl2br|nl2br )
{{ var|nl2br|nl2br }}

5. Re-escape values that are escaped for an other contexts
( var|escape_something|escape|nl2br )
{{ var|escape_something|nl2br }}

6. Still escape when using filters not declared safe
( var|escape|nl2br|upper|escape )
{{ var|nl2br|upper }}

{% endautoescape %}
